import { METHOD, PATH } from "./config";
import { request } from "./core";

const APIClient = {
  install(Vue) {
    Vue.prototype.$API = this;
  },
  getBanner(params) {
    return request(METHOD.GET, PATH.getBanner, params);
  },
  getappIndex(params) {
    return request(METHOD.GET, PATH.getappIndex, params);
  },
  getcourseInfo(params) {
    return request(METHOD.GET, PATH.getcourseInfo + `basis_id=${params}`);
  },
  information(params) {
    return request(METHOD.POST, PATH.information, params);
  },
  courseBasis(params) {
    return request(METHOD.GET, PATH.courseBasis, params); //排序
  },
  courseComment(params) {
    return request(METHOD.POST, PATH.courseComment, params);
  },
  smsCode(params) {
    return request(METHOD.POST, PATH.smsCode, params);
  },
  login(params) {
    return request(METHOD.POST, PATH.login, params);
  },
  userInfo(params) {
    return request(METHOD.GET, PATH.userInfo, params);
  },
  courseClassify(params) {
    return request(METHOD.GET, PATH.courseClassify, params);
  },
  myInviteCourse(params) {
    return request(METHOD.POST, PATH.myInviteCourse, params);
  },
  sonArea(params) {
    return request(METHOD.GET, PATH.sonArea + `/ ${params}}`);
  },
  user(params) {
    return request(METHOD.PUT, PATH.user, params);
  },
  attribute(params) {
    return request(METHOD.GET, PATH.attribute, params);
  },
};

export default APIClient;
